package quinn.web.server;

import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import quinn.web.util.DosCmdTool;
import quinn.web.util.XmlDom4jParse;

public class CtrlPowerDao {
	private XmlDom4jParse xmlDom4jParse = null;
	private DosCmdTool dosCmdTool= null;
	public CtrlPowerDao(String path) {
		xmlDom4jParse = new XmlDom4jParse(path+"PcInfo.xml");
		dosCmdTool = new DosCmdTool();
	}
	
	public List getPcName() {
		return xmlDom4jParse.getAllPcName();
	}

	/**
	 * get pc ip mac to map
	 * @return
	 */
	public Map getAllPcStatus() {
		Iterator it = getPcName().iterator();
		Map pcsInfo = new HashMap<String, Map>();
		while(it.hasNext()) {
			String pc = (String) it.next();
			Map onePc = xmlDom4jParse.getPcConfByName(pc);
			pcsInfo.put(pc, onePc);
		}
		return pcsInfo;
	}
	
	
}
